Skip to content

Remove uuid and @stdlib/utils-copy from @tryghost/errors#426

Merged
9larsons merged 1 commit intomainfrom
remove-errors-uuid-stdlib
Mar 2, 2026
Merged

Remove uuid and @stdlib/utils-copy from @tryghost/errors#426
9larsons merged 1 commit intomainfrom
remove-errors-uuid-stdlib

Conversation

@9larsons
Copy link
Collaborator

@9larsons 9larsons commented Mar 2, 2026

Summary

  • Replace uuid with Node.js built-in crypto.randomUUID() (switches from v1 time-based to v4 random UUIDs — fine for error IDs)
  • Replace @stdlib/utils-copy with an inline deepCloneValue() function (structuredClone can't be used because it drops custom properties on Error subclasses)
  • Remove @types/uuid dev dependency
  • @tryghost/errors now has zero external runtime dependencies

Test plan

  • All 62 existing tests pass
  • 100% code coverage maintained
  • Added test for array deep cloning in errorDetails

Replace uuid with crypto.randomUUID() and @stdlib/utils-copy with an
inline deep clone function. structuredClone can't be used because it
drops custom properties on Error subclasses.

The errors package now has zero external runtime dependencies.
@coderabbitai
Copy link

coderabbitai bot commented Mar 2, 2026

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

📥 Commits

Reviewing files that changed from the base of the PR and between a7c0e5a and 8e6ef71.

📒 Files selected for processing (4)
  • packages/errors/package.json
  • packages/errors/src/GhostError.ts
  • packages/errors/src/utils.ts
  • packages/errors/test/utils.test.ts
 _________________________
< Loose code sinks ships. >
 -------------------------
  \
   \   \
        \ /\
        ( )
      .( o ).

✏️ Tip: You can disable in-progress messages and the fortune message in your review settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch remove-errors-uuid-stdlib

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@9larsons 9larsons merged commit a447d77 into main Mar 2, 2026
3 of 4 checks passed
@9larsons 9larsons deleted the remove-errors-uuid-stdlib branch March 2, 2026 17:27
@codecov-commenter
Copy link

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (a7c0e5a) to head (8e6ef71).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #426   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          133       133           
  Lines         8630      8649   +19     
  Branches      1460      1466    +6     
=========================================
+ Hits          8630      8649   +19     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants